package com.ymttest.database.sqlwapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.core.tool.Logger;
import com.ymt.database.SqlManager;
import com.ymttest.database.model.IpChunHui;
import com.ymttest.database.model.LoginLog;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.YMTDateUtil;

/************************************************************************************
 * @File name :DefaultWapper.java
 * @Author : zhouyi
 * @Date : 2015年6月1日
 * @Copyright : 洋码头
 ************************************************************************************/
public class LoginLogWapper {
	SqlManager manage;

	public LoginLogWapper() {
		manage = new SqlManager("ymtuserdb");
	}

	public List<LoginLog> selectByuserid(Integer userid){
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("userid", userid);
		List<LoginLog> logs = manage.getSelectResults(
				"com.ymttest.database.mapping.LoginLogMapper.selectByuserid", params);
		return logs;
	}
	
	/**
	 * 关闭数据库连接
	 */
	public void close() {
		manage.close();
	}

	@Override
	protected void finalize() throws Throwable {
		this.close();
		manage = null;
		super.finalize();
	}
}
